/*
 * @Author: EltonLi lijiaming@uavi-tech.com
 * @Date: 2023-09-07 16:53:21
 * @LastEditors: LVGRAPE
 * @LastEditTime: 2025-04-10 11:41:42
 * @FilePath: \zino-fc-v4\ZINO\imu\imu.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef __IMU_H__
#define __IMU_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include "fc_sensors.h"
#include <rtdef.h>


typedef struct _imu_s
{
    float q0;
    float q1;
    float q2;
    float q3;
    float rMat[3][3];
    float ki;
    float kp;
    float integralFBx;
    float integralFBy;
    float integralFBz;
} __attribute__((packed)) m_imu_t;



extern m_imu_t fc_ctrl_imu;
void MahonyAHRS(m_imu_t *imu, fc_sensor_data_t *data, float dt);
float getCosTiltAngle(void);
void Get_imu_data(fc_sensor_data_t *sensor, zdrone_state_t *state);
#ifdef __cplusplus
}
#endif

#endif /* ZINO_IMU_IMU_H_ */
